<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>JSTI标签库</title>
<style type="text/css">
table{ border: 3px solid red;}
th,td{ border-bottom: 1px dotted red; border-right: 1px dotted red;}
</style>
</head>
<body>
<h1>JSTI标签库测试</h1>
Jsp<span style='color: red;'>动态Web项目</span>开发实践<br>
${"Jsp<span style='color: red;'>动态Web项目</span>开发实践"}<br>
课程：<c:out value="Jsp<span style='color: red;'>动态Web项目</span>开发实践"></c:out><br>
课程：<c:out value="Jsp<span style='color: red;'>动态Web项目</span>开发实践" escapeXml="false"></c:out><br>
年龄：<c:out value="${param.age}" escapeXml="false" default="20"></c:out><br>
年龄：<c:out value="${param.age}" escapeXml="false">18</c:out>
<hr>
<c:set var="name" value="张三" scope="page"></c:set>
<c:set var="name" value="李四" scope="request"></c:set>
<c:set var="name" value="王五" scope="session"></c:set>
<c:set var="name" value="杨柳" scope="application"></c:set>
\${pageScope.name}=${pageScope.name}<br>
\${requestScope.name}=${requestScope.name}<br>
\${sessionScope.name}=${sessionScope.name}<br>
\${applicationScope.name}=${applicationScope.name}<br>
<c:set var="name" value="朝气" scope="page"></c:set>
//使用set标签修改page作用域的name值<br>
\${name}=${name}
<hr>
<c:remove var="name" scope="page"/>
//使用remove标签删除Page作用域的name值<br>
\${name}=${name}<br>
<c:remove var="name"/>
//使用remove标签删除所有作用域的name值<br>
\${name}=${name}<br>
<hr>
number=${param.number},
<c:if test="${param.number%2==0}">偶数</c:if>
<c:if test="${param.number%2!=0}">奇数</c:if>
<hr>
<table border=0 cellspacing=0 cellpadding=10>
	<tr><th>序号</th><th>数据</th><th>数据的平方</th></tr>
<c:forEach items="0,9,8,7,6,5,4,3,2,1" var="n" varStatus="s" begin="2">
	<tr><td>${s.index}</td><td>${n}</td><td>${n*n}</td></tr>
</c:forEach>
</table>
<hr>
<c:set var="names" value="张三,李四;王五、杨柳"></c:set>
<c:forEach items="${names}" varStatus="s" var="it">
	${s.count}.${it}<br>
</c:forEach><br>
<c:forTokens items="${names}" delims=",;、"  varStatus="s" var="it">
	${s.count}.${it}<br>
</c:forTokens>
<hr>
<c:set var="hello" value="  How are you?  |  I'm fine , Thank you.  |  And you?  "></c:set>
<c:set var="hi" value="${fn:split(hello,'|')}"></c:set>
<c:forEach varStatus="s" items="${hi}" var="hi">
	${s.count}.${fn:trim(hi)}[${fn:length(fn:trim(hi))}]<br>
</c:forEach>
<hr>
</body>
</html>